package com.scc.servlet;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.scc.entites.DishEntity;
import com.scc.services.IDishSetupService;

@Controller
@RequestMapping(value = "/GetAllDishes")
public class GetAllDishes
{
    @Autowired
    IDishSetupService setupService;
    
    @RequestMapping(method = RequestMethod.GET)
    public String showForm(ModelMap model)
    {
        List<DishEntity> list = setupService.getAllDishes();
        model.addAttribute("DISHES", list);
        return "alldishes";
    }
}
